export const debounce = (fn: any, delay: any) => {
  let timer: any
  return (...args: any[]) => {
    if (timer) {
      clearTimeout(timer) // 清除前一个定时器
    }
    timer = setTimeout(() => {
      fn(...args) // 调用函数，传递参数
    }, delay)
  }
}